package com.mycompany.calendar;

import java.util.Date;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class Teste {
    public static void main(String[] args) {
        EntityManagerFactory factory = Persistence.createEntityManagerFactory("CalendarPU");
        EntityManager em = factory.createEntityManager();
        
        Atividade a = new Atividade();
        a.setDataInicio(new Date());
        a.setDataFinal(new Date());
        a.setPrioridade("Imediata");
        
        em.getTransaction().begin();
        em.persist(a);
        em.getTransaction().commit();
    }
}
